package de.muc.vanbeek.bf;

import java.util.Collection;

import javax.annotation.concurrent.ThreadSafe;

import de.muc.vanbeek.ba.CustomerLoaderBA;
import de.muc.vanbeek.bci.CustomerBCI;
import de.muc.vanbeek.be.CustomerBE;

/**
 * The business facade (*BF) is the implementation of the business component interface (BCI).
 * 
 * It should be stateless and implement the facade pattern, which means that it delegates
 * the business logic to other objects. Logging, error handling and other cross cutting concerns
 * can be handled here, which makes the facade the natural target of aspects.
 * 
 * Since BFs are stateless, they should be singletons that are threadsafe by default.
 */
@ThreadSafe
public class CustomerBF implements CustomerBCI {

	private final CustomerLoaderBA mCustomerLoaderBA;
	
	public CustomerBF(CustomerLoaderBA pCustomerLoaderBA) {
		mCustomerLoaderBA = pCustomerLoaderBA;
	}
	
	@Override
	public Collection<CustomerBE> getAllTestBEs() {
		return mCustomerLoaderBA.getAllCustomers();
	}

}
